<template>
  <div class="craneNo">{{ craneNo }}</div>
  <!-- <div class="unitInfo">
    <div class="content flex justify-center items-center"> -->
  <!-- <span>CA1出口: 空5个</span>
      <span>CA2出口: 空6个</span>
      <span class="alert">CA5出口: 空0个</span>
      <span class="alert">CA5入口: 空9个</span> -->
  <!-- <span
        v-for="ele in saddleList"
        :key="ele.equipmentNo"
        :class="{ highlighted: ele.highLighted === 1 }"
        :style="{ color: ele.highLighted === 1 ? '#f00' : 'inherit' }"
        >{{ ele.equipmentName }}: 空{{ ele.nullCount }}个</span
      >
    </div>
  </div> -->
  <!-- <div class="carInfo">
    <div class="content flex column">
      <div class="flex column" v-for="ele in parkingList" :key="ele.carNo">
        <span>{{ ele.jobType }}: {{ ele.carNo }}</span>
        <span>车到时间: {{ ele.carArriveDate }}min</span>
        <span>材料数量: {{ ele.matSum }}</span>
      </div> -->
  <!-- <div class="flex column">
        <span>重车: WZ20210107097</span>
        <span>车到时间: 5min</span>
        <span>材料数量: 55</span>
      </div>
      <div class="flex column">
        <span>重车: WZ20210107097</span>
        <span>车到时间: 5min</span>
        <span>材料数量: 55</span>
      </div>
      <div class="flex column">
        <span>重车: WZ20210107097</span>
        <span>车到时间: 5min</span>
        <span>材料数量: 55</span>
      </div> -->
  <!-- </div>
  </div> -->
</template>

<script lang="ts">
import { defineComponent, PropType } from 'vue';
import { SaddleRow, ParkingRow } from './model';

export default defineComponent({
  name: 'terminal-crane-left-info',

  props: {
    craneNo: {
      type: String,
      required: true,
    },
    saddleList: {
      type: Array as PropType<SaddleRow[]>,
      required: true,
    },
    parkingList: {
      type: Array as PropType<ParkingRow[]>,
      required: true,
    },
  },

  setup() {
    return {};
  },
});
</script>

<style lang="scss" scoped>
@font-face {
  font-family: 'Furore';
  src: url('src/assets/fonts/Furore.otf') format('opentype');
}

.container {
  width: 1024px;
  height: 768px;
  margin: 0 auto;
  position: relative;
  background-color: #000; /* 添加背景颜色以更好地查看布局 */
}

.craneNo {
  position: absolute;
  width: 16.9%;
  height: 11.2%;
  top: 10%;
  left: 2%;
  font-size: 8vh;
  text-align: center;
  line-height: 10vh;
  color: #fff;
  font-family: 'Furore', sans-serif; /* 应用字体 */
  background-image: url('src/assets/terminal/1_crane_bg.png');
  background-size: contain;
}

.unitInfo {
  position: absolute;
  width: 26.37%;
  height: 20.83%;
  top: 38.15%;
  left: 4.88%;
  background-image: url('src/assets/terminal/1_unit_bg.png');
  background-size: cover;

  .content {
    position: absolute;
    width: 77.78%;
    height: 87.5%;
    top: 5%;
    left: 31.48%;
    color: #fff;
    font-size: 2.08vh;

    span {
      width: 100%;
      height: 10.42%;
      line-height: 10.42%;
    }

    .alert {
      color: #ff1a1a;
      background-color: rgba(255, 26, 26, 0.5);
      animation: flash 1s infinite;
    }
  }
}

.carInfo {
  position: absolute;
  width: 10%;
  height: 68.45%;
  right: 3.13%;
  top: 11.98%;
  background-image: url('src/assets/terminal/1_carIn_bg.png');
  background-size: cover;

  .content {
    position: absolute;
    width: 100%;
    height: 68.45%;
    left: 0;
    bottom: 0;
    font-size: 2.34vh;
    color: #fff;

    div {
      margin-top: 3.26%;
      margin-left: 2.19%;
    }
  }
}

.highlighted {
  animation: blink 1s infinite;
  background-color: rgba(255, 0, 0, 0.2);
  padding: 0;
  margin-right: 3.13%;
}

@keyframes blink {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}
</style>
